package org.wddsicmd.widgets;
 
import org.wddsicmd.app.CodeEditorMain;
import org.wddsicmd.app.ButtonTabComponent;
import org.wddsicmd.util.ResourceBundleUtil;
import org.wddsicmd.util.Log;
import org.wddsicmd.util.Resource;

import java.lang.Object;

import java.io.*;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import java.util.*;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;

import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.Insets;
import java.awt.Color;
import java.awt.Toolkit;
import java.awt.Image;
import java.awt.event.*;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.Container;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.Timer;
import javax.swing.JTable;
import javax.swing.table.*;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.Icon;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.event.TreeModelListener;
import javax.swing.filechooser.FileSystemView;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.border.EmptyBorder;
import javax.swing.text.Document;

import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;

import javax.swing.Icon;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.plaf.basic.BasicGraphicsUtils;

public class MssPanel extends JPanel {

	private final static String TAG = "MssPanel";
	private JLabel mMssInfoLabel;
	
	public MssPanel(CodeEditorMain cem, String titleStr){
		super();
		
		setLayout(null);
		setBackground(Resource.getBackgroundColor());
		addComponentListener(new ComponentAdapter() {
			@Override
			public void componentResized(ComponentEvent e) {
				onComponentResized();
			}
		});		

		MssInfoInit();
		
	}
	public void onComponentResized(){
		int width = getWidth();
		int height = getHeight();

/* doom-2015-11-2 15:2:0 
		Log.d(TAG, "onComponentResized width: "+ width);
		Log.d(TAG, "onComponentResized height: "+ height);
 doom-2015-11-2 15:2:0 */
		int textwidth = width/3;
		int textheight = height/2;

		mMssInfoLabel.setBounds(new Rectangle((width- textwidth)/2, (height- textheight)/2, textwidth, textheight));

	}
	private void MssInfoInit(){

		mMssInfoLabel = new JLabel();		
		mMssInfoLabel.setFont(new java.awt.Font("Dialog",  0,  24));   
		mMssInfoLabel.setVerticalAlignment(JTextField.CENTER);
		mMssInfoLabel.setHorizontalAlignment(JTextField.CENTER);
		mMssInfoLabel.setText("<html>Version:1.151102<br>Author:Wan Sir<br>Tel:1234567890<br>QQ:1234567890</html>"); 
/* doom-2015-11-2 16:46:5 
		mMssInfoLabel.setBackground(Resource.getHighlightColor());
 doom-2015-11-2 16:46:5 */
		add(mMssInfoLabel);
	}
}
